import os

from app.utils.milvus_do import MilvusDo
#
# a = MilvusDo()
# # a.create_index("fin")
#
# a.search_by_searchName(
#     collectionName="fin",
#     searchName="nd calculation basis of Fund infomation; please refe",
#     limit=10,
#
# )

# a.delete_by_fileName(
#     collection_name="sfat",
#     file_name="MMT Mayer Report (Remitted) (Part II).txt")

# a.upload_file_to_milvus(memory_name="sfat",
#                         file_path="C:\\Users\\Administrator\\Desktop\\poc\\mmt\\MMT Mayer Report (Remitted) (Part II).pdf.txt",
#                         file_name="MMT Mayer Report (Remitted) (Part II).pdf.txt",
#                         file_from="mmt"
#                         )

# def get_all_file_paths_and_names(directory):
#     file_info = []
#     for root, _, files in os.walk(directory):
#         for file in files:
#             file_path = os.path.join(root, file)
#             file_info.append((file_path, file))  # 保存路径和文件名
#     return file_info
#
# # 示例用法
# directory = "C:\\Users\\Administrator\\Desktop\\poc\\fin"
# all_files = get_all_file_paths_and_names(directory)
# for file_path ,file_name in all_files:
#     print(file_path)
#     print(file_name)
#     a.upload_file_to_milvus(
#         memory_name="fin",
#                             file_path=file_path,
#                             file_name=file_name,
#                             file_from="fin"
#                             )